var http = require("http");
var url = require("url");
var util = require('util');

http.createServer(function(req,res){
   // 解析 url 参数
    var params = url.parse(req.url, true).query;
    var pathname = url.parse(req.url).pathname;
    console.log("username: "+ params.username+"  ... psd: "+params.psd);

     //这里指定编码，处理乱码的问题
    res.writeHead(200, {'Content-Type': 'text/plain;charset=utf-8'});

  
    res.write("username===>" + params.username);
    res.write("\n");
    res.write("psd===>" + params.psd);
    res.end();

}).listen(8888);